home *** CD-ROM | disk | FTP | other *** search
- .Na "dbaltcolid"
- .Aa
- .Fu
- Return the column id for a compute column.
- .Ih "compute column, returning operand column id of"
- .Sy
- .Sf "int dbaltcolid(dbproc, computeid, column)"
- .Sp "DBPROCESS" "*dbproc"
- .Sp "int" "computeid"
- .Sp "int" "column"
- .Co
- .Bl
- This routine returns the \f2select-list\f1 id for a compute column.
- For example, given the SQL statement:
- .SD
- .in +5n
- .ne 3
- select dept, name from employee
- order by dept, name
- compute count(name) by dept
- .in -5n
- .ED
- the call
- .I "dbaltcolid(dbproc, 1, 1)"
- will return 2, since \f2name\f1 is
- the second column in the \f2select-list\f1.
- .Bz
- .Pa
- .Pi dbproc
- A pointer to the DBPROCESS structure that provides the connection
- for a particular front end/\*S process. It contains all the
- information that \*L uses to manage communications and data between the
- front end and \*S.
- .Pi computeid
- The id that identifies the particular compute row of interest.
- A SQL SELECT statement may have multiple COMPUTE clauses,
- each of which returns a separate compute row.
- The \f2computeid\f1 corresponding to the
- first COMPUTE clause in a SELECT is 1.
- The \f2computeid\f1 is returned by \f2dbnextrow()\f1
- or \f2dbgetrow().\f1
- .Pi column
- The number of the compute column of interest. The first column in a \f2select-list\f1 is 1.
- .in -.375i
- .Re
- .br
- The \f2select-list\f1 id for the compute column.
- The first column in a \f2select-list\f1 is 1. If either the
- .I "computeid"
- or the
- .I column
- are invalid, \f2dbaltcolid()\f1 returns -1.
- .Sa
- dbadata,
- dbadlen,
- dbaltlen,
- dbgetrow,
- dbnextrow,
- dbnumalts,
- dbprtype
-